package com.qingcloud.base.remote.executor;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 实例运行日志返回对象
 *
 * @author wangjinnan
 */
@Getter
@Setter
@ToString
public class JobInstanceFileLog implements Serializable {

    @ApiModelProperty(value = "往前读从哪里取日志", example = "1")
    private String preStart;

    @ApiModelProperty(value = "往后读从哪里取日志", example = "1")
    private String afterStart;

    @ApiModelProperty(value = "日志内容")
    private List<String> logs;

    public static JobInstanceFileLog empty() {
        final JobInstanceFileLog fileLog = new JobInstanceFileLog();
        fileLog.setAfterStart("0");
        fileLog.setPreStart("0");
        fileLog.setLogs(Collections.emptyList());
        return fileLog;
    }
}
